@extends("layouts.main")
@section('title','课程列表')
@section('keywords','课程列表')
@section('description','课程列表')
@section("content")
    <link rel="stylesheet" type="text/css" href="assets/css/course.css">
    <main>

        <div class="scroll-content" id="scroll-content" data-page="scroll-content">

            <!-- PAGE TOP -->
            <div class="page-top">
                <div class="page-caption">
                    <div class="page-inner">
                    </div>
                </div>
            </div>

            <!-- MAIN CONTENT -->
            <div class="main-content" style="max-width: 100%">
                @if(!empty($tree))
                    @foreach($tree as $key=>$item)
                        <div class="course" @if($key%2==0)style="width: 20%;background: rgba(25, 49, 100, 0.3)"@else style="width: 20%;background: rgba(25, 49, 100, 0.8)"@endif>
                            @if($key%2==0)
                            <div class="course-title">
                                <div class="number-title">@if($key<10){{'0'.($key+1)}}@else{{$key}}@endif</div>
                                <div class="section-title">{{$item['name']}}</div>
                            </div>
                            @endif
                            @if(!empty($item['children']))
                                @foreach($item['children'] as $value)
                                    <div style="margin: 25px;border-radius: 10px;background: rgba(50, 80, 143, 0.82)">
                                        <div class="number-child-title">{{$value['name']}}</div>
                                        @if(!empty($value['children']))
                                            <div class="course-ul">
                                                <ul>
                                                    @foreach($value['children'] as $val)
                                                        <li class="course-li"><a href="{{route('detail',['sid'=>$val['id'],'ks'=>\App\Util\Helper::randString(26)])}}">{{$val['name']}}</a></li>

                                                    @endforeach
                                                </ul>
                                            </div>
                                        @endif
                                    </div>
                                @endforeach
                            @endif
                            @if($key%2!=0)
                                    <div class="course-title">
                                        <div class="number-title">@if($key<10){{'0'.($key+1)}}@else{{$key}}@endif</div>
                                        <div class="section-title">{{$item['name']}}</div>
                                    </div>
                            @endif

                        </div>
                    @endforeach
                @endif

            </div>

        </div>

    </main>
@endsection
